home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000036_icon-group-sender_Wed Mar 12 12:53:03 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
1KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2CJpgM04093
for icon-group-addresses; Wed, 12 Mar 2003 12:51:42 -0700 (MST)
Message-Id: <200303121951.h2CJpgM04093@baskerville.CS.Arizona.EDU>
X-Sender: whm@mail.mse.com
Date: Wed, 12 Mar 2003 09:43:20 -0700
To: icon-group@cs.arizona.edu
From: "William H. Mitchell" <whm@mse.com>
Subject: Re: Sorting lists
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
A list of lists is sorted by time of creation, oldest first. That's
usually not very useful. sortf(L,i) sorts a list of lists by the value of
the i-th element of the sublists. Assuming your example depicts a list of
lists containing strings, sortf(L, 1) would produce the result you hope for.
At 02:21 PM 3/12/03 +0000, rjhare@ed.ac.uk wrote:
>I don't have the book to hand and am sitting in an Icon-free zone at
>the moment. What do I get if I sort a list of lists like this:
>
>[ [b,c], [a,d] ]
>
>I hope I get:
>
>[ [a,d], [b,c]]
>
>but fear that I might get:
>
>[ a, b, c, d]